package com.insigma.business.qrcode.soldier._consumer.impl;


import com.insigma.business.qrcode.common.dto.CommonAdminAreaDTO;
import com.insigma.business.qrcode.common._provider.CommonAdminAreaProvider;
import com.insigma.business.qrcode.common.vo.BaseResponse;
import com.insigma.business.qrcode.soldier.dto.SoldierBasicInfoDTO;
import com.insigma.business.qrcode.soldier.request.BaseGetRequest;
import com.insigma.business.qrcode.soldier._consumer.HeroServiceConsumer;
import com.insigma.business.qrcode.soldier._provider.SoldierBasicInfoProvider;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service("heroServiceConsumer")
public class HeroServiceConsumerImpl implements HeroServiceConsumer {

    @Resource
    private CommonAdminAreaProvider commonAdminAreaProvider;
    @Resource
    private SoldierBasicInfoProvider soldierBasicInfoProvider;

    @Override
    public String analyseAreaCodeByBasicInfoForOther(String address) {
        return commonAdminAreaProvider.analyseAreaCodeByBasicInfoForOther(address).getDto();
    }

    @Override
    public CommonAdminAreaDTO getCommonAdminArea(String id) {
        return commonAdminAreaProvider.getCommonAdminArea(new BaseGetRequest(id)).getDto();
    }

    @Override
    public BaseResponse<SoldierBasicInfoDTO> getSoldierBasicInfoBySoldierId(String soldierId) {
        return soldierBasicInfoProvider.getSoldierBasicInfoBySoldierId(soldierId);
    }

    @Override
    public List<CommonAdminAreaDTO> findSubAreaList(String adminAreaCode) {
        return commonAdminAreaProvider.findSubAreaList(adminAreaCode).getDto();
    }
}
